import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  base: process.env.NODE_ENV === 'production' ? '/vue-mobile-hxqui/' : './',
  server:{
    host:'0.0.0.0',
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: '@import "./src/styles/reset.scss";',
      },
    },
  },
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url)),
      'assets': fileURLToPath(new URL('./src/assets', import.meta.url)),
      'views': fileURLToPath(new URL('./src/views', import.meta.url)),
      'utils': fileURLToPath(new URL('./src/utils', import.meta.url)),
      'stores': fileURLToPath(new URL('./src/stores', import.meta.url)),
      'router': fileURLToPath(new URL('./src/router', import.meta.url))
    }
  }
})
 